package com.right.health.app.base;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/*
 * Created by hopeliao on 2018/12/26
 *
 */
class ClassUtil {

    static Class getGenericClass(Class<?> clazz) {
        Type type = clazz.getGenericSuperclass();
        if (type instanceof ParameterizedType) {
            Type[] ptype = ((ParameterizedType) type).getActualTypeArguments();
            return (Class) ptype[0];
        }
        return null;
    }
}
